package com.briup.jz.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.briup.jz.bean.AccountCustomerExample;
import com.briup.jz.bean.AccountEmployee;
import com.briup.jz.bean.AccountEmployeeExample;
import com.briup.jz.dao.AccountEmployeeMapper;
import com.briup.jz.dao.extend.AccountEmployeeExtendMapper;
import com.briup.jz.service.IAccountEmployeeService;

@Service
public class AccountEmployeeServiceImpl implements IAccountEmployeeService{
	@Autowired
	private AccountEmployeeMapper ac;
	@Autowired
	private AccountEmployeeExtendMapper ca;
	@Override
	public List<AccountEmployee> findAll() {
		// TODO Auto-generated method stub
		return ac.selectByExample(new AccountEmployeeExample());
	}

	@Override
	public void saveOrUpdate(AccountEmployee c1) {
		// TODO Auto-generated method stub
		if(c1.getId()==null) {
			ac.updateByExample(c1, new AccountEmployeeExample());
		}else {
			ac.insert(c1);
		}
	}

	@Override
	public AccountEmployee findById(Long id) {
		// TODO Auto-generated method stub
		return ac.selectByPrimaryKey(id);
	}

	@Override
	public void delete(Long id) {
		// TODO Auto-generated method stub
		ac.deleteByPrimaryKey(id);
	}

	@Override
	public List<AccountEmployee> pageQuery(int page, int pageSize, String status, String type, Long beginTime,
			Long endTime,Long user_id) {
		int pageIndex=(page-1)*pageSize;
		List<AccountEmployee> lists=ca.pageQuery(pageIndex, pageSize, status, type, beginTime, endTime,user_id);
		return lists;
	}
	
}
